Public Class Wizard
    Inherits System.Windows.Forms.Form

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        ColorDialog1.ShowDialog()
        primarybg.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox1.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        ColorDialog1.ShowDialog()
        category.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox2.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        ColorDialog1.ShowDialog()
        title.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox3.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        ColorDialog1.ShowDialog()
        win1.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox4.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        ColorDialog1.ShowDialog()
        win2.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox5.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        ColorDialog1.ShowDialog()
        win3.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox6.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        ColorDialog1.ShowDialog()
        primarytext.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox7.BackColor = ColorDialog1.Color
    End Sub
    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        ColorDialog1.ShowDialog()
        links.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox8.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        ColorDialog1.ShowDialog()
        linkhover.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox9.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        ColorDialog1.ShowDialog()
        titletext.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox10.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        ColorDialog1.ShowDialog()
        bots.Text = ColorTranslator.ToHtml(ColorDialog1.Color)
        PictureBox11.BackColor = ColorDialog1.Color
    End Sub

    Private Sub Wizard_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'set default values
        Me.StartPosition = FormStartPosition.CenterScreen
        Width = 395
        Height = 295
        back.Enabled = False
        finish.Enabled = False
        copyright.Text = Today
        clsGlobal.steps = 4
        clsGlobal.cstep = clsGlobal.steps - 1
        clsGlobal.fram = 0
        Frame2.Left = Frame1.Left
        Frame2.Top = Frame1.Top
        Frame2.Width = Frame1.Width
        Frame3.Left = Frame1.Left
        Frame3.Top = Frame1.Top
        Frame3.Width = Frame1.Width
        Frame4.Left = Frame1.Left
        Frame4.Top = Frame1.Top
        Frame4.Width = Frame1.Width
        Frame2.Visible = False
        Frame3.Visible = False
        Frame4.Visible = False
        update_colors()
        check_frame()
        Text = "Wizard - Introduction"
        'MsgBox cstep
    End Sub

    Private Sub back_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles back.Click
        'check to see if current frame is negative
        If clsGlobal.fram < 0 Then
            clsGlobal.fram = 0
            Exit Sub
        Else
            'current frame - 1
            clsGlobal.fram = clsGlobal.fram - 1
        End If
        'check the current frame
        check_frame()
    End Sub

    Private Sub nextt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nextt.Click
        If clsGlobal.fram = clsGlobal.cstep Then
            'set current frame to step number
            clsGlobal.fram = clsGlobal.cstep
        Else
            'current frame + 1
            clsGlobal.fram = clsGlobal.fram + 1
        End If
        'check the current frame
        check_frame()
    End Sub

    Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
        Visible = False
    End Sub

    Private Sub finish_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles finish.Click
        gen_dat()
        gen_html()
        gen_css()
        load_data()
        load_html()
        load_css()
        check_mdichild()
        Visible = False
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        update_colors()
    End Sub
End Class